import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import axios from 'axios'
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/style/index.scss';
import "./utils/directives.js";
import VueInsProgressBar from 'vue-ins-progress-bar'

import VideoPlayer from 'vue-video-player'
import 'vue-video-player/src/custom-theme.css'
import 'video.js/dist/video-js.css'

import noData from '@/components/noData.vue'

import Header from '@/components/header.vue';
import Footer from '@/components/Footer.vue';


Vue.use(VideoPlayer)
Vue.use(ElementUI);

import {
	formatDate
} from '@/utils/date.js'

const options = {
	position: 'fixed',
	show: true,
	height: '3px'
}
Vue.use(VueInsProgressBar, options)

// Vue.use(axios)
// Vue.prototype.$ajax = axios
Vue.config.productionTip = false
Vue.prototype.formatDate = formatDate


Vue.prototype.$axios = axios;
// 请求基准路径的配置
// Vue.prototype.url = 'http://dikuang.ytzpgl.cn';
// Vue.prototype.url = 'http://dikuang.nameme.cn';
// Vue.prototype.url = 'http://117.73.254.217:2221/resources/';
Vue.prototype.url = 'http://117.73.254.217:2221';

Vue.prototype.noData = '暂无';

Vue.prototype.msgSuccess = function(msg) {
	this.$message({
		showClose: true,
		message: msg,
		type: "success"
	});
}

Vue.prototype.msgError = function(msg) {
	this.$message({
		showClose: true,
		message: msg,
		type: "error"
	});
}

Vue.prototype.msgInfo = function(msg) {
	this.$message.info(msg);
}


// 全局组件挂载
Vue.component('noData', noData)
Vue.component('Header', Header)
Vue.component('Footer', Footer)
// (axios.defaults.timeout = 10000),
// 将axios挂载到Vue的原型对象上
// 在别的组件中 this.$http
// (Vue.prototype.$http = axios);

// new Vue({
//   router,
//   store,
//   render: h => h(App)
// }).$mount('#app')

XE.ready().then(function startup() {
	new Vue({
		router,
		store,
		render: h => h(App)
	}).$mount('#app')
});
